{extend name="index/nav" /}}
{block name="main"}
<div class="body">
    <div class="">
        <h2>用户列表</h2>
    </div>
    <div class="index-table">
        <table class="am-table am-table-bordered am-table-radius am-table-striped" id="mytable">
            <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>性别</th>
                <th>地址</th>
                <th>生日</th>
                <th>手机号码</th>
                <th>EMAIL</th>
                <th>身份证号</th>
            </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
</div>


<script src='/static/index/js/jquery-1.11.0.min.js'></script>
<script>
    $(function(){
        $('#collapse-nav1').addClass('am-in');
        //       屏幕高度
        var heigth=document.body.offsetHeight-90;
        $('.body').css('height',heigth+'px');

        //        表格数据
        $.post('{:url("admin/index/user")}',function(res){
            for(var i=0;res.length;i++){
                var data=res[i];
                data.name=data.name==null?'':data.name;
                data.sex=data.sex==0?'男':'女';
                data.address=data.address==null?'':dataaddress;
                data.birthday=data.birthday==null?'':data.birthday;
                data.phone=data.phone==null?'':data.phone;
                data.email=data.email==null?'':data.email;
                data.idcard=data.idcard==null?'':data.idcard;
                $('#mytable tbody').append(`<tr><td>${data.id}</td><td>${data.name}</td><td>${data.sex}</td><td>${data.address}</td><td>${data.birthday}</td><td>${data.phone}</td><td>${data.email}</td><td>${data.idcard}</td></tr>`);
            }
        })

    })

</script>
{/block}